package com.hansheng.entity;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by GoldenMan on 2017/7/5.
 */
@Entity
@Table(name = "mother_sheet", schema = "hansheng")
public class MotherSheetEntity {
    private int msid;
    private Integer mid;
    private String msNo;
    private Integer materialDete;
    private Integer operator;
    private Integer length;
    private Integer width;
    private Integer height;
    private Integer count;
    private Double weightThe;
    private Double weightAct;
    private Timestamp addTime;
    private String remark;
    private Integer status;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "msid", nullable = false)
    public int getMsid() {
        return msid;
    }

    public void setMsid(int msid) {
        this.msid = msid;
    }

    @Basic
    @Column(name = "mid", nullable = true)
    public Integer getMid() {
        return mid;
    }

    public void setMid(Integer mid) {
        this.mid = mid;
    }

    @Basic
    @Column(name = "msNo", nullable = true, length = 255)
    public String getMsNo() {
        return msNo;
    }

    public void setMsNo(String msNo) {
        this.msNo = msNo;
    }

    @Basic
    @Column(name = "materialDete", nullable = true)
    public Integer getMaterialDete() {
        return materialDete;
    }

    public void setMaterialDete(Integer materialDete) {
        this.materialDete = materialDete;
    }

    @Basic
    @Column(name = "operator", nullable = true)
    public Integer getOperator() {
        return operator;
    }

    public void setOperator(Integer operator) {
        this.operator = operator;
    }

    @Basic
    @Column(name = "length", nullable = true)
    public Integer getLength() {
        return length;
    }

    public void setLength(Integer length) {
        this.length = length;
    }

    @Basic
    @Column(name = "width", nullable = true)
    public Integer getWidth() {
        return width;
    }

    public void setWidth(Integer width) {
        this.width = width;
    }

    @Basic
    @Column(name = "height", nullable = true)
    public Integer getHeight() {
        return height;
    }

    public void setHeight(Integer height) {
        this.height = height;
    }

    @Basic
    @Column(name = "count", nullable = true)
    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    @Basic
    @Column(name = "weightThe", nullable = true, precision = 0)
    public Double getWeightThe() {
        return weightThe;
    }

    public void setWeightThe(Double weightThe) {
        this.weightThe = weightThe;
    }

    @Basic
    @Column(name = "weightAct", nullable = true, precision = 0)
    public Double getWeightAct() {
        return weightAct;
    }

    public void setWeightAct(Double weightAct) {
        this.weightAct = weightAct;
    }

    @Basic
    @Column(name = "addTime", insertable = false, nullable = false)
    public Timestamp getAddTime() {
        return addTime;
    }

    public void setAddTime(Timestamp addTime) {
        this.addTime = addTime;
    }

    @Basic
    @Column(name = "remark", nullable = true, length = 255)
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Basic
    @Column(name = "status", nullable = true)
    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        MotherSheetEntity that = (MotherSheetEntity) o;

        if (msid != that.msid) return false;
        if (mid != null ? !mid.equals(that.mid) : that.mid != null) return false;
        if (msNo != null ? !msNo.equals(that.msNo) : that.msNo != null) return false;
        if (materialDete != null ? !materialDete.equals(that.materialDete) : that.materialDete != null) return false;
        if (operator != null ? !operator.equals(that.operator) : that.operator != null) return false;
        if (length != null ? !length.equals(that.length) : that.length != null) return false;
        if (width != null ? !width.equals(that.width) : that.width != null) return false;
        if (height != null ? !height.equals(that.height) : that.height != null) return false;
        if (count != null ? !count.equals(that.count) : that.count != null) return false;
        if (weightThe != null ? !weightThe.equals(that.weightThe) : that.weightThe != null) return false;
        if (weightAct != null ? !weightAct.equals(that.weightAct) : that.weightAct != null) return false;
        if (addTime != null ? !addTime.equals(that.addTime) : that.addTime != null) return false;
        if (remark != null ? !remark.equals(that.remark) : that.remark != null) return false;
        if (status != null ? !status.equals(that.status) : that.status != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = msid;
        result = 31 * result + (mid != null ? mid.hashCode() : 0);
        result = 31 * result + (msNo != null ? msNo.hashCode() : 0);
        result = 31 * result + (materialDete != null ? materialDete.hashCode() : 0);
        result = 31 * result + (operator != null ? operator.hashCode() : 0);
        result = 31 * result + (length != null ? length.hashCode() : 0);
        result = 31 * result + (width != null ? width.hashCode() : 0);
        result = 31 * result + (height != null ? height.hashCode() : 0);
        result = 31 * result + (count != null ? count.hashCode() : 0);
        result = 31 * result + (weightThe != null ? weightThe.hashCode() : 0);
        result = 31 * result + (weightAct != null ? weightAct.hashCode() : 0);
        result = 31 * result + (addTime != null ? addTime.hashCode() : 0);
        result = 31 * result + (remark != null ? remark.hashCode() : 0);
        result = 31 * result + (status != null ? status.hashCode() : 0);
        return result;
    }
}
